﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace vkUpploaderLib
{
    public class ParametersCollection
    {
        private Dictionary<string, string> _parameters;

        public ParametersCollection()
        {
            _parameters = new Dictionary<string, string>();
        }

        public void Add(string paramName, string value)
        {
            _parameters.Add(paramName, value);
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (var parameter in _parameters)
            {
                sb.AppendFormat("{0}={1}&", parameter.Key, parameter.Value);
            }
            if (sb.Length == 0)
                return null;
            return sb.ToString(0, sb.Length - 1);
        }
    }
}
